<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="xml" omit-xml-declaration="yes"/>
  <xsl:param name="jsx_id">searchlistthumbnail</xsl:param>
  <xsl:template match="/">
	  <script type="text/javascript">
		  function viewItem(itemId){
		  	var itemRecord = snowsoft.gibay.APP.getCache().getDocument("MODEL_ResultItems").getRecord(itemId);
		  	jsx3.require("snowsoft.gibay.ViewItemDetail");
		  	snowsoft.gibay.publish({subject:snowsoft.gibay.Event.ON_VIEWITEM,target:this,itemRecord:itemRecord});
		  }
		</script>
	  <ul class="myitems_container">
    	<xsl:for-each select="//record">
     		<li> 
      			<xsl:choose>
        			<xsl:when test="@GalleryURL=''">
        			</xsl:when>
        			<xsl:otherwise>
						<a class="itemlink" href="/" onclick="viewItem('{@ItemID}');return false;" title="{@Title}"><img src="{@GalleryURL}" width="128" height="128" border="0"/></a>
						<div class="title">
							<xsl:value-of select="@Title"/>
						</div>
						<div>
							Price:<xsl:value-of select="@CurrentPrice"/>
						</div>
						<div>
							Bids:<xsl:value-of select="@BidCount"/>
						</div>
        			</xsl:otherwise>
      			</xsl:choose>
 			</li> 
  		</xsl:for-each>
  	  </ul>
  </xsl:template>
</xsl:stylesheet>
